<?php
/* @var $this DefaultController */
/* @var $model Doitac */

$this->breadcrumbs=array(
	'Doitacs'=>array('index'),
	'Manage',
);
?>
<div class="col-md-12">
    <div class="box box-primary">
        <div class="box-header">
            <h1 class="box-title">Quản lý đối tác</h1>
            <div class="pull-right top5" style="margin: 8px 9px;">
			    <a style="color:#fff;" href="<?php echo Yii::app()->createUrl('/DoiTac/default/create'); ?>" class="btn btn-primary">Thêm mới đối tác</a>
			 </div>
        </div><!-- /.box-header -->
        <div class="box-body">
           
			<?php $this->widget('ext.GLGridView', array(
				'id'=>'doitac-grid',
				'dataProvider'=>$model->search(),
				'filter'=>$model,
				'cssFile' => Yii::app()->theme->baseUrl . '/css/gridView.css',
				'columns'=>array(
					'id',
					array(
						'name'=>'ten',
						'htmlOptions'=>array('class'=>'name-ten'),
					),
					array(
						'name'=>'ma_so',
						'htmlOptions'=>array('class'=>'ma-doitac'),
					),
					'dia_chi',
					'dien_thoai',
					array(
						'name'=>'id_loai_hinh_kinhdoanh',
						'value'=>'$data->kinhdoanh != null ? $data->kinhdoanh->ten_loaihinh : "Không có"'
					),
					array(
						'name'=>'cam_ket',
						'value'=>'$data->cam_ket."%"'
					),
					array(
						'name'=>'chi_phi_dv',
						'value'=>'$data->chi_phi_dv."%"'
					),
					array(
						'name'=>'tong_doanh_thu',
						'value'=>'getMoney($data->tong_doanh_thu)',
					),
					array(
						'name'=>'tong_chiet_khau',
						'value'=>'getMoney($data->tong_chiet_khau)',
						'htmlOptions'=>array('class'=>'tongchietkhau'),
					),
					array(
						'name'=>'tong_chi_phi',
						'value'=>'getMoney($data->tong_chi_phi)',
						'htmlOptions'=>array('class'=>'tongchiphi'),
					),
					array(
						'name'=>'da_thanh_toan',
						'value'=>'getMoney($data->da_thanh_toan)',
						'htmlOptions'=>array('class'=>'da-thanhtoan'),
					),
					array(
						'name'=>'chua_thanh_toan',
						'value'=>'getMoney($data->chua_thanh_toan)',
						'htmlOptions'=>array('class'=>'chua-thanhtoan'),
					),

					/*
					'mo_ta',
					'website',
					'cam_ket',
					'so_hop_dong',
					
					'ngay_vao_so',
					'phan_tram',
					*/
					array(
						'class'=>'CButtonColumn',
						'template' => ' {view} {update}',
					),
				),
			)); ?>
        </div><!-- /.box-body -->
    </div><!-- /.box -->
</div>
<style type="text/css">
	.box .box-body .table {
		margin-bottom: 27px;
		}
		a.view{display: none;}
		a.update img{
			width: 20px;
		}
		.grid-view tbody tr{
			cursor: pointer;
		}
</style>
<script type="text/javascript">
	$(".grid-view tbody tr").live("click", function(){
	  window.location.href = $(this).find(".view").attr("href");
	});
</script>

